package cn.teamwork.ssm.controller;

import cn.teamwork.ssm.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

@Controller
@RequestMapping("user")
public class UserController {

    @Autowired
    private UserService service;

    @RequestMapping("list")
    public Map<String, Object> list(Integer page, Integer size){
        return service.list(page, size);
    }

    @ResponseBody
    @RequestMapping("checkUser")
    public  Long checkUser(String username, String name){

        return service.checkUser(username, name);
    }

    @RequestMapping("addUser")
    public String addUser(){
        return "addUser";
    }

}
